/**
 * VYPe11 Project
 * VYPe11 language compiler.
 * Authors: Jozef Lang (xlangj01), 
 * 			Zoltan Zemko (xzemko01)
 * 2011
 */
package cz.vutbr.fit.VYPe.team18.VYPe11.sematic;

import java.util.Stack;

public class TACcounter {
	private int termIndex;
	private int labelIndex;
	private Stack<Integer> whileLabelStack;
	
	
	public TACcounter() {
		termIndex=0;
		labelIndex=0;
		whileLabelStack=new Stack<Integer>();
	}

	public int getTermIndex() {
		return termIndex;
	}

	public int getLabelIndex() {
		return labelIndex;
	}
	
	public void incrementTermIndex() {
		termIndex++;
	}
	
	public void incrementLabelIndex() {
		labelIndex++;
	}
	
	public int getNextTermIndex() {
		int i = getTermIndex();
		this.incrementTermIndex();
		return i;
	}
	
	public int getNextLabelIndex() {
		int i = getLabelIndex();
		this.incrementLabelIndex();
		return i;
	}
	
	public Stack<Integer> getWhileLabelStack() {
		return whileLabelStack;
	}
}
